#include<linux/module.h>
#include<linux/init.h>
MODULE_LICENSE("GPL");
static int __init __module_address_init(void);
static void __exit __module_address_exit(void);

int a_module(void)
{
	return 0;
}
int __init __module_address_init(void)
{
	struct module * ret;
	unsigned long addr = (unsigned long)a_module;
	/* */
	preempt_disable();
	ret=__module_address(addr);
	preempt_enable();

	if(ret != NULL)
	{
		printk(KERN_EMERG "ret->name: %s\n",ret->name);	
		printk(KERN_EMERG "ret->state: %d\n",ret->state);	
		printk(KERN_EMERG "ret->core_size: %d\n",ret->core_size);	
		printk(KERN_EMERG "refs of %s is %d \n",ret->name,module_refcount(ret));
	}
	else{
		printk(KERN_EMERG "__module_address return NULL !");	
	}
	return 0;
}
void __exit __module_address_exit(void)
{
	printk(KERN_EMERG "module exit ok!\n");
}
module_init(__module_address_init);
module_exit(__module_address_exit);
